package priv.yiyuan.example.design.proxy;

/**
 * 用户服务代理类
 * <p>
 * 代理主题类
 *
 * @author YiYuan
 * @data 2025/9/24
 * @apoNote
 */
public class UserServiceProxy implements UserService {

    private UserService target;

    public UserServiceProxy(UserService target) {
        this.target = target;
    }

    @Override
    public void registerUser(String username, String password) {

        System.out.println("代理前置处理: 记录操作日志 - 用户 " + username + " 尝试注册。");

        target.registerUser(username, password);

        System.out.println("代理后置处理: 记录操作日志 - 用户 " + username + " 注册操作完成。");

    }

}
